#ifndef TEXTURES_H
#define TEXTURES_H

#include <QtGui>

#include <defs/export.h>
#include <defs/global.h>


namespace Opl{ namespace Gui {

        namespace Helpers { namespace OpenGL {
                class GLTexture;
            };};

        O_PRIVATE_DECLARE(Textures);
        class EXPORTED Textures : public QObject {
            Q_OBJECT
        public:
            Textures(QObject *parent = 0);
            ~Textures();

            /*!
              Add GLTexture object, Texture object
              take ownership and destroy object at the end
              */
            bool append(int id, Helpers::OpenGL::GLTexture* item);
            bool append(int id, const QImage& image);
            bool append(int id, const QString& fileName);

            int size()const;

            void bind(int id);
            void bind();
            void unbind();

            static Textures* instance();

        private:
            Q_DISABLE_COPY(Textures);
            O_PRIVATE_DECLARE_MEMBER(Textures);
        };

    };};

#endif // TEXTURES_H

